<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 10px solid red;
            position: absolute
        }
    </style>
</head>
<body>
</body>
<script>
    var divList = [];
    for (var i = 0; i < 30; i++) {
        var div = document.createElement("div");
        document.body.appendChild(div);
        div.style.borderWidth = "10px";
        var red = Math.floor(Math.random() * 256);
        var green = Math.floor(Math.random() * 256);
        var blue = Math.floor(Math.random() * 256);
        div.style.borderColor = "rgb(" + red + "," + green + "," + blue + ")";
        divList.push(div);
    }
    document.onmousemove = function (ev) {
        var evt = window.event || ev;
        var x = evt.clientX;
        var y = evt.clientY;
        divList[0].style.left = x + "px";
        divList[0].style.top = y + "px";
        for (var i = divList.length-1; i >0; i--) {
            divList[i].style.left = divList[i-1].offsetLeft + "px";
            divList[i].style.top = divList[i-1].offsetTop + "px";
        }
    }
</script>
</html>